<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML>
<html>
  <head>
    
    <title>商品出货单管理</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    	
	
	<link rel="stylesheet" type="text/css" href="<%=basePath %>css/manual.css">
	
  </head>
  
  <body>
  
  <table  width="100%"  border="0" cellpadding="0" cellspacing="0" height="100%">
  	<tr valign="top">
  	
  		<td height="100">
  			 <jsp:include page="/background/head.jsp"></jsp:include>
  		</td>
  	</tr>
  	<tr valign="top">
  		<td>
  		
   
   
  <table width="100%"  border="0" cellpadding="0" cellspacing="0">
  
 <tr>
    	<td width="270" align="center">
    		
    	</td>
    	<td width="100%">

    	</td>
    </tr>
    
    <tr>
    	<td valign="top">
     		<div>
     		
     		</div>
					<s:include value="/background/left.jsp"></s:include>		
     	</td>
     	
     	
     	<td valign="top" >
     	
     	<table width="100%" border="0" cellpadding="0" bgcolor="#e5f3ff" cellspacing="0" style= "border:1px solid #ffffff; border-top-color:#6cb1f1;">
     		<tr>
     			<td>查找出货信息
				<input type="button" value="查看谁有权限" 
     				onclick="javascript:openUrlForDialog('selectuserlimited_warehouse.action?limitedCode=<s:property value="limitedcode"/>')"/>
     				
     			</td>
     			<td align="right">  </td>
     		</tr>
     	</table>
     	
     	<table align="center">
     		<tr>
     			<td><s:fielderror id="errormessage" /></td>
     		</tr>
     	</table>
     	
    <form id="managereceiptlist_warehouse" name="managereceiptlist_warehouse" onSubmit="return true;" action="receiptlistreport_warehouse.action" method="POST" >
    	
			<table  border="0" >
				<tr>
				  <td width="120">
					  查找出货信息:
					
				  </td>
				  <td>
					 
					<input type="text" name="searchStr" size="30" value="<s:property value="searchStr"/>"/>
				  </td>
			  </tr>
			  <tr>
				  <td>
					
					 利润值:
				  </td>
				  <td>
					
					 <input type="text" name="profitValue" size="10" value="<s:property value="profitValue"/>"/>
					  <input type="submit" value="查找" />
				  </td>
			  </tr>
			</table>
	</form> 
	
	
		<table width="100%" border="0" cellpadding="0" bgcolor="#e5f3ff" cellspacing="0" style= "border:1px solid #ffffff; border-top-color:#6cb1f1;">
     		<tr>
     			<td>出货单列表</td>
     		</tr>
     	</table>
		
		
		
		<table >
			<tr>
				
					<td style="border-bottom:#e5f3ff solid 1px;" width="515" align="center">产品</td>
					
					<td style="border-bottom:#e5f3ff solid 1px;" width="105" align="center">总价(元)</td>
					<td style="border-bottom:#e5f3ff solid 1px;" width="105" align="center">用户ID</td>
					<td style="border-bottom:#e5f3ff solid 1px;" width="115" align="center">流程状态</td>
			
					<td style="border-bottom:#e5f3ff solid 1px;" width="115" align="center">操作人</td>

				</tr>
		</table>
		<table  width="100%" style= "width: 100%">   
			<s:iterator id="receiptlistList" value="receiptlistList">
				<tr>

						
						<td width="100%">
							<table border="0" cellpadding="0"  cellspacing="0" width="100%"  style= "border:1px solid #ffffff; border-bottom-color:#b2d5ff;
    border-left-color:#b2d5ff;border-right-color:#b2d5ff;border-top-color:#b2d5ff">
									<tr>
										<td>
											<table bgcolor="#f3f7fc">
												<tr>
													<td>
													<s:if test="#receiptlistList.state_receiptlist == 9">
														<s>出单号:</s><a href="receiptlistinfo_warehouse.action?id=<s:property value="#receiptlistList.id_receiptlist"/>" title="<s:property value="#receiptlistList.department_receiptlist"/>"><s:property value="#receiptlistList.id_receiptlist"/></a>
														</s:if>
					
															<s:else>
															
															出单号:<a href="receiptlistinfo_warehouse.action?id=<s:property value="#receiptlistList.id_receiptlist"/>" title="<s:property value="#receiptlistList.department_receiptlist"/>"><s:property value="#receiptlistList.id_receiptlist"/></a>
														
															</s:else>
															<font color="#cccccc">快递单号:<s:property value="#receiptlistList.shipno_receiptlist"/></font>
															<font color="red">
															利润:
															<s:property value="#receiptlistList.profit_receiptlist"/></font>
													<td>
														
													</td>
													<td align="right">
														出单时间:<s:property value="#receiptlistList.date_receiptlist"/>
													</td>
													
												 	
												</tr>
											</table>
										</td>
									</tr>
									<tr>
										<td>
											<table border="1" cellpadding="0"  cellspacing="0" bordercolor="#f5f5f5" style="border-collapse:collapse; border-width:1px 0 0 1px;">
												<tr>
													<td width="515" >
													
													
													
													<s:iterator id="receiptList" value="receiptListMap.get(#receiptlistList.id_receiptlist)">
														<table >
															<tr>
																<td width="105">
																 	
																	
																</td>
																<td width="62">
																 	<img alt="" src="<s:property value="#receiptList.image_receipt"/>" width="60" height="60"/>
																	
																</td>
																<td width="243">
																
																<a href="#">
																<s:property value="#receiptList.goodsname_receipt"/>
																</a>
																</td>
																
																<td width="105" align="center">
																
																
																
																<s:if test="#receiptList.number_receipt > 1">
																<font color="red">
																
																(<s:property value="#receiptList.number_receipt"/>件)
																</font>
																</s:if>
																<s:else>
																
																(<s:property value="#receiptList.number_receipt"/>件)
																
																</s:else>
																</td>
															</tr>
															
														</table>
													</s:iterator>
													
														
													</td>
													
													<td align="center">
														<s:property value="#receiptlistList.total_receiptlist"/></br>
														<font color="#cococo">(快递:<s:property value="#receiptlistList.shipprice_receiptlist"/>)
														</font>
														</br>
														<font color="green">(实发:
														<s:property value="flowRecordlistMap.get(#receiptlistList.id_receiptlist).doublevalue_recordlist"/>
														)</font>
													</td>
													
													<td align="center" title="<s:property value="#receiptlistList.customerinfo_receiptlist"/>">
														<s:property value="#receiptlistList.customerid_receiptlist"/>
													</td>
													
													<td align="center">
														
														<s:property value="flowRecordlistMap.get(#receiptlistList.id_receiptlist).cnname_recordlist"/>
															<br/>
															<button onclick="javascript:window.showModalDialog('<%=basePath %>flow/enterflow.action?kind=HOUSEWARE.RECEIPTLIST&kindid=<s:property value="#receiptlistList.id_receiptlist"/>','son','DialogWidth:800px;DialogHeight:600px;')">
																查看流程
														</button>
													</td>
													
													<td align="center">
													
															
														<s:property value="#receiptlistList.username_receiptlist"/>
														
														
														
													
													</td>
												</tr>
											</table>
										</td>
									</tr>
									<s:if test="#receiptlistList.remark_receiptlist!=''">
									<tr>
										<td bgcolor="fff7d9">
										<table>
											<tr>
											<td bgcolor="fff7d9">
											备注：<s:property value="#receiptlistList.remark_receiptlist"/>
											
										</td>
										<td align="right"><a href="premodifyreceiptlist_warehouse.action?id=<s:property value="#receiptlistList.id_receiptlist"/>">修改</a>	</td>
										</tr>
										</table>
										
										</td>
									</tr>
									</s:if>
									
									
							</table>
						
						
						</td>
						
					
						
						
							
						
				</tr>
			</s:iterator>
		</table>
	
	<table width="100%" border="0" cellpadding="0" bgcolor="" cellspacing="0" >
				<tr >
					<td >
						<%
						
						 String url = "receiptlistreport_warehouse.action";//*/
						 
						int pageSize = (Integer) request.getAttribute("pageSize");
						int beginPageNum =  (Integer) request.getAttribute("beginPageNum");
						int countRow =  (Integer) request.getAttribute("rowNum");
					    int countPage =(countRow-1)/pageSize+1;
					    int currentPage = countPage - (countRow-beginPageNum)/pageSize;
					   // String brand = (String)request.getAttribute("brand");//*/
					   
					   double profitValue = (Double) request.getAttribute("profitValue");
					   
					    
					    String searchstr = (String)request.getParameter("searchStr");//*/
					    if(searchstr != null){
					    	searchstr = java.net.URLDecoder.decode(searchstr, "UTF-8");
					    	searchstr = java.net.URLEncoder.encode(searchstr,"UTF-8");
					    	searchstr = searchstr.replaceAll("%", "%25");
					    }else{
					    	searchstr = "";
					    }
					    
					    if((beginPageNum-pageSize+1) >= 1){%>
				    	<a href="<%=url %>?searchStr=<%=searchstr %>&profitValue=<%=profitValue %>&beginPageNum=<%=(beginPageNum-pageSize) %>">
								上一页 </a>
				 	  <% }
					    
					    //beginPageNum =  (pageNum - 1) * pageSize;
						StringBuffer chagePageBuff = new StringBuffer();
						if(countPage >= 2){ 
							int begin = currentPage - 9;
							int end = currentPage + 9;
							
							if(begin < 1){
								begin = 0;
							}
							if(end > countPage){
								end = countPage-1;
							}
							
							
							for(int i=begin;i<countPage;i++){
								
								
								
								
								
								if(beginPageNum == i*pageSize){
									%>
									<%=i+1 %>
									<%
								}else{
									%>
									<a href="<%=url %>?searchStr=<%=searchstr %>&profitValue=<%=profitValue %>&beginPageNum=<%=i*pageSize %>">
									[<%=i+1 %>] </a>
									<%
								}
								
								if(i > end){
									
									break;
									
								}
							}
						}
						
						if((beginPageNum+pageSize-countRow) < 0){%>
				    	<a href="<%=url %>?searchStr=<%=searchstr %>&profitValue=<%=profitValue %>&beginPageNum=<%=(beginPageNum+pageSize) %>">
								下一页 </a>
				   		<% }
						if(countPage != 1){%>
			    		<input type="text" size="4" id="goPageNum" name="goPageNum"/> / <%=countPage %> <button onclick="gotoPage();">跳转</button>
				   		<% }
						//*/
						%>
					</td>

				</tr>
				
			</table>
			
	</td>
	
	
	
</tr>

</table>

</td>
</tr>
<tr valign="bottom">
	<td>
		<jsp:include page="/manual/tail.jsp"></jsp:include>
	</td>
</tr>
</table>



  </body>
<script type="text/javascript">



function gotoPage(){
	countPage = <%=countPage %>;
	pageSize = <%=pageSize %>;
	pageNum = document.getElementById("goPageNum").value;

	pageNum = parseInt(pageNum);
	if(pageNum > countPage){
		pageNum = countPage;
	}
	beginPageNum = pageNum * pageSize - pageSize;
	if(beginPageNum < 0){
		beginPageNum = 0;

	}
	if(isNaN(beginPageNum)){
		beginPageNum = 0;
	}
	url = '<%=url %>?searchStr=<%=searchstr %>&profitValue=<%=profitValue %>&beginPageNum=' + beginPageNum;
	//alert(url);
	window.location.href=url;
}
</script>
</html>
